home *** CD-ROM | disk | FTP | other *** search
/ 3D World 113 / 3DW_113.iso / pc / Menu / Scenes / home.dir / Internal_42_Open Media Player Rose.ls < prev    next >
Encoding:
Text File  |  2008-09-12  |  2.6 KB  |  104 lines

  1. property Sp, SpriteList, pRadius, RoseOpen, RoseMode, tc, bWidth, fWidth, aRad, degMod, aDegMod
  2.  
  3. on beginSprite me
  4.   Sp = sprite(me.spriteNum)
  5.   tc = 0
  6.   bWidth = 60
  7.   fWidth = 100
  8.   degMod = 90
  9.   aRad = 0
  10.   Sp.width = bWidth
  11.   Sp.height = bWidth
  12.   sprite(Sp).member.centerRegPoint = 1
  13.   pRadius = 70
  14.   RoseOpen = 0
  15.   SpriteList = [:]
  16.   SpriteList = [sprite(22), sprite(23), sprite(24), sprite(25), sprite(26)]
  17.   repeat with i = 1 to SpriteList.count
  18.     SpriteList[i].loc = Sp.loc
  19.     SpriteList[i].visible = 0
  20.     SpriteList[i].member.centerRegPoint = 1
  21.   end repeat
  22. end
  23.  
  24. on exitFrame me
  25.   if RoseOpen = 0 then
  26.     if mGetDistance(the mouseLoc, Sp.loc) < pRadius then
  27.       OpenRose()
  28.       RoseOpen = 1
  29.     end if
  30.   end if
  31.   if RoseOpen then
  32.     if mGetDistance(the mouseLoc, Sp.loc) > (pRadius + 20) then
  33.       CloseRose()
  34.       RoseOpen = 0
  35.     end if
  36.   end if
  37.   case RoseMode of
  38.     "exp":
  39.       if tc <> 1.0 then
  40.         tc = tc + 0.20000000000000001
  41.         Sp.width = bWidth + float((fWidth - bWidth) * tc)
  42.         Sp.height = bWidth + float((fWidth - bWidth) * tc)
  43.         aDegMod = degMod * tc
  44.         aRad = pRadius * tc
  45.       else
  46.         RoseMode = "Open"
  47.         Sp.width = 89
  48.         Sp.height = 90
  49.         repeat with i = 1 to SpriteList.count
  50.           SpriteList[i].visible = 1
  51.         end repeat
  52.         put tc
  53.       end if
  54.     "shk":
  55.       if tc > 0.0 then
  56.         tc = tc - 0.20000000000000001
  57.         Sp.width = bWidth + float((fWidth - bWidth) * tc)
  58.         Sp.height = bWidth + float((fWidth - bWidth) * tc)
  59.         aDegMod = degMod * tc
  60.         aRad = pRadius * tc
  61.       else
  62.         RoseMode = "closed"
  63.         repeat with i = 1 to SpriteList.count
  64.           SpriteList[i].visible = 0
  65.         end repeat
  66.       end if
  67.   end case
  68.   baseLoc = point(Sp.locH, Sp.locV)
  69.   deg = 360 / SpriteList.count
  70.   repeat with o = 1 to SpriteList.count
  71.     SpLoc = getXYPos(vector(baseLoc.locH, baseLoc.locV, 0), (deg * (o - 1)) - aDegMod, aRad)
  72.     SpriteList[o].loc = point(SpLoc.x, SpLoc.y)
  73.     SpriteList[o].blend = tc * 100
  74.   end repeat
  75. end
  76.  
  77. on CloseRose
  78.   tc = 1.0
  79.   RoseMode = "shk"
  80. end
  81.  
  82. on OpenRose
  83.   repeat with i = 1 to SpriteList.count
  84.     SpriteList[i].visible = 1
  85.     SpriteList[i].blend = 0
  86.   end repeat
  87.   tc = 0
  88.   RoseMode = "exp"
  89. end
  90.  
  91. on getXYPos origin, ang, dist
  92.   myA = DegreesToRads(ang)
  93.   return vector(origin.x + (dist * cos(myA)), origin.y + (dist * sin(myA)), 0)
  94. end
  95.  
  96. on DegreesToRads aAngle
  97.   return aAngle * PI / 180
  98. end
  99.  
  100. on mGetDistance aPoint, AnotherPoint
  101.   pDistance = sqrt(power(aPoint.locH - AnotherPoint.locH, 2) + power(aPoint.locV - AnotherPoint.locV, 2))
  102.   return pDistance
  103. end
  104.